;
(function() {
	var skill = {
		getGoodsEndPayCallbackBuff: function(goods_id) {
			var goods = this._getGoods(goods_id);
			var cb_url_buff = goods.getEndPayCallbackBuff();
			return cb_url_buff;
		}.perm("this.getPerm().can_set_goods_call_back_buff", "权限不足，需开通成高级VIP才能使用"),
		//为商品添加购买完成后的回调地址
		setGoodsEndPayCallbackBuff: function(goods_id, callback_url, args) {
			if (!helper.isUrl(callback_url)) {
				throwCusError("回调地址格式不正确");
			}
			var goods = this._getGoods(goods_id);
			var cb_url_buff = goods.getEndPayCallbackBuff();
			if (cb_url_buff) {
				cb_url_buff.info.cb_url = callback_url
				cb_url_buff.info.args = args;
				cb_url_buff.save();
			} else {
				cb_url_buff = new BuffCon({
					name: "支付回调",
					alone: "cb_url",
					hidden: true,
					code_id: "商品交易完成访问回调地址",
					info: {
						cb_url: callback_url,
						args: args
					}
				});
				goods._addBuff(cb_url_buff._id);
			}
			goods = $Object.clone(goods);
			goods.cb_url_buff = cb_url_buff;
			return goods
		}.perm("this.getPerm().can_set_goods_call_back_buff", "权限不足，需开通成高级VIP才能使用")
	};
	module.exports = skill;
	var db = require("../db/index");
	var DomainCon = require("../domain/_con");
	var GoodsCon = require("../goods/_con");
	var UserCon = require("../../core/user/_con");
	var BusCon = require("../../core/bus/_con");
	var AchCon = require("../ach/_con");
	var ClassifyCon = require("../bus.classify/_con");
	var TagCon = require("../bus.tag/_con");
	var LeagueCon = require("../league/_con");
	var BuffCon = require("../buff/_con");
	var BusUserBindCon = require("../bus_user_bind/_con");
	var BusGuideCon = require("../bus.guide/_con");
	var CommentCon = require("../comment/_con");
	var config = require("../_include/config");
	var data_cut = require("../_include/data_cut");
	var helper = require("../_include/helper");
	var md5 = require("../_include/md5");
	var $Object = require("../_include/$.Object");
	var $Array = require("../_include/$.Array");
	var tld = require('tldjs');
	var fs = require("fs");
	var Fiber = require('fibers');
}());